home *** CD-ROM | disk | FTP | other *** search
/ Whiteline: delta / whiteline CD Series - delta.iso / systems / unixtkit / man.arc / MAKE.MAN < prev    next >
Text File  |  1988-03-28  |  7KB  |  199 lines

  1.  
  2.  
  3.  
  4.         MAKE                  ST-UNIX User's Manual                  MAKE
  5.  
  6.  
  7.  
  8.         COMMAND
  9.              make - rule based file maintainer.
  10.  
  11.         FORMAT
  12.              make [ -f makefile ] [ option ] ...  name ...
  13.  
  14.         DESCRIPTION
  15.              _✓M_✓a_✓k_✓e executes commands in _✓m_✓a_✓k_✓e_✓f_✓i_✓l_✓e to  update  one  or  more
  16.              target  _✓n_✓a_✓m_✓e_✓s.   If  no -f option is present, `makefile' and
  17.              `Makefile' are tried in order.   If  _✓m_✓a_✓k_✓e_✓f_✓i_✓l_✓e  is  `-',  the
  18.              standard input is taken.  More than one -f option may appear
  19.  
  20.              _✓M_✓a_✓k_✓e parses the file to produce  a  list  of  pre-requisites
  21.              specified  for each target.  The target is updated if any of
  22.              its pre-requisites have changed since it was last modified.
  23.  
  24.              _✓M_✓a_✓k_✓e_✓f_✓i_✓l_✓e contains a sequence of entries that specify  depen-
  25.              dencies.   The  first  line of an entry is a blank-separated
  26.              list of targets, then a colon, then a list  of  prerequisite
  27.              files.   Text following a semicolon, and all following lines
  28.              that begin with a tab, are shell commands to be executed  to
  29.              update the target.
  30.  
  31.              All text from a '#' to the end of the line is treated  as  a
  32.              comment and ignored.  _✓M_✓a_✓k_✓e_✓f_✓i_✓l_✓e entries of the form
  33.  
  34.                   string1 = string2
  35.  
  36.              are  variable  assigments.    Variables   are   invoked   by
  37.              $(_✓s_✓t_✓r_✓i_✓n_✓g_✓1)  or  ${_✓s_✓t_✓r_✓i_✓n_✓g_✓1} and cause _✓s_✓t_✓r_✓i_✓n_✓g_✓2 to be inserted.
  38.              Parentheses are not needed if _✓s_✓t_✓r_✓i_✓n_✓g_✓1 is a single character.
  39.  
  40.              _✓M_✓a_✓k_✓e infers prerequisites for files for which _✓m_✓a_✓k_✓e_✓f_✓i_✓l_✓e gives
  41.              no construction commands.  The default prerequisites are set
  42.              up to be used with the lattice C compiler and linker however
  43.              they  may be easily redefined by the user to work with what-
  44.              ever compiler is in use.  An example of the inferences made;
  45.              a  `.c'  file  may  be inferred as prerequisite for a `.bin'
  46.              file and be compiled to produce the `.bin' file.   Thus  the
  47.              following  example  shows  that prog.prg depends on prog.bin
  48.              which depends on prog.c which in turn depends on all.h:
  49.  
  50.                   prog.prg: prog.bin
  51.                             c.lnk prog.bin -WITH C -PROG prog.bin
  52.                   prog.bin: prog.c
  53.                             lc prog.c
  54.                   prog.c: all.h
  55.              Now using the default pre-requisites we  can  re-write  this
  56.              as:
  57.  
  58.              prog.c: all.h
  59.  
  60.  
  61.  
  62.  
  63.         Printed 28/March/1988     30 March 1987                         1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.         MAKE                  ST-UNIX User's Manual                  MAKE
  71.  
  72.  
  73.  
  74.              and all the other dependencies will be inferred.
  75.  
  76.              Prerequisites are inferred according  to  selected  suffixes
  77.              listed  as  the  `prerequisites' for the special name `.SUF-
  78.              FIXES'; multiple lists accumulate; an empty list clears what
  79.              came  before.  Order is significant; the first possible name
  80.              for which both a file and a rule as described  in  the  next
  81.              paragraph exist is inferred.  The default list is
  82.  
  83.                   .SUFFIXES: .tos .ttp .prg .bin .c
  84.  
  85.              The suffixes used will depend  upon  the  compiler  you  are
  86.              using,  thus  lattice  C  will generate `.bin' files whereas
  87.              magamax will generate `.o' files.  The default  actions  for
  88.              make  are  to  use the lattice compiler `lc' to compile with
  89.              and the lattice linker `c.lnk' to link with.
  90.  
  91.              To overide these defaults the CC variable (initially set  to
  92.              `lc')  may  be  set  to the compiler you are using, with the
  93.              CFLAGS variable (initially not used) choosing any options to
  94.              the  compiler.  The LD variable (initially `c.lnk') controls
  95.              linking in a similar manner with the LDFLAGS variable  (ini-
  96.              tially  `-WITH  C -NOLIST') which can again be overridden by
  97.              the user.
  98.  
  99.              The rule to create a file with suffix _✓s_✓2 that depends  on  a
  100.              similarly named file with suffix _✓s_✓1 is specified as an entry
  101.              for the `target' _✓s_✓1_✓s_✓2.
  102.  
  103.              The special macro $* stands for the target name with  suffix
  104.              deleted,  $@  for  the full target name, $< for the complete
  105.              list of prerequisites, and $? for the list of  prerequisites
  106.              that are out of date.  For example, a rule for making `.bin'
  107.              files from `.c' files is
  108.  
  109.                   .c.bin: ; $(CC) $(CFLAGS) $*.c
  110.  
  111.              The Variable `CFLAGS' is used to send  arguments  to  the  C
  112.              compiler,  and  `MFLAGS'  contains  the command line options
  113.              supplied to _✓m_✓a_✓k_✓e.
  114.  
  115.              Similarly the rule to make `.tos' files from `.bin' file is:
  116.  
  117.                   .bin.tos: ; $(LD) $*.bin $(LDFLAGS) -PROG $@
  118.  
  119.              A line is printed when it is  executed  unless  the  special
  120.              target  `.SILENT'  is in _✓m_✓a_✓k_✓e_✓f_✓i_✓l_✓e, or the first character of
  121.              the command is `@'.
  122.  
  123.              Commands returning nonzero status cause  _✓m_✓a_✓k_✓e  to  terminate
  124.              unless  the  special  target `.IGNORE' is in _✓m_✓a_✓k_✓e_✓f_✓i_✓l_✓e or the
  125.              command begins with <tab><hyphen>.
  126.  
  127.  
  128.  
  129.         Printed 28/March/1988     30 March 1987                         2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.         MAKE                  ST-UNIX User's Manual                  MAKE
  137.  
  138.  
  139.  
  140.              Other options:
  141.  
  142.              -i   Equivalent to the special entry `.IGNORE:'.
  143.  
  144.              -k   When a command returns nonzero status, abandon work  on
  145.                   the current entry, but continue on branches that do not
  146.                   depend on the current entry.
  147.  
  148.              -n   Trace and print, but do not execute the commands needed
  149.                   to update the targets.
  150.  
  151.              -t   Touch,  i.e.  update  the  modified  date  of  targets,
  152.                   without executing any commands.
  153.  
  154.              -r   Equivalent to an  initial  special  entry  `.SUFFIXES:'
  155.                   with no list.
  156.  
  157.              -s   Equivalent to the special entry `.SILENT:'.
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.         Printed 28/March/1988     30 March 1987                         3
  196.  
  197.  
  198.  
  199.